<template>
    <div>
        <div style="font-size: 18px;font-weight: 600;color: rgba(0, 0, 0, .6);margin-bottom: 16px;">基础信息</div>
        <div class="flex flex_wrap" style="margin-bottom: 16px;">
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>车种：</div>
                </div>
                <a-auto-complete v-model="itemData.car_type" :data="carTypeData" @blur="carTypeSaveHistory" @search="handleCarTypeSearch" :style="{flex:1}" placeholder="请输入车种"/>
                <!-- <a-input v-model="itemData.car_type" :style="{flex:1}" placeholder="请输入车种" allow-clear /> -->
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>车号：</div>
                </div>
                <a-input v-model="itemData.car_no" :style="{flex:1}" placeholder="请输入车号" allow-clear />
            </div>
            
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>办理时间：</div>
                </div>
                <a-date-picker
                    style="flex:1"
                    v-model="itemData.process_time"
                    format="YYYY-MM-DD"
                />
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>运输方式：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.transport_type" :options="props.yunshuList" :field-names="{ value: 'key', label: 'title' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择运输方式" />
                </div>
                
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>服务方式：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select  v-model="itemData.service_type" :options="serviceList" :field-names="{ value: 'key', label: 'title' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择服务方式" />
                </div>
                
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>收货人：</div>
                </div>
                <a-auto-complete v-model="itemData.shipper" :data="tuoyunData" @blur="tuoyunSaveHistory" @search="handleTuoyunSearch" :style="{flex:1}" placeholder="请输入收货人"/>
                <!-- <a-input v-model="itemData.shipper" :style="{flex:1}" placeholder="请输入收货人" allow-clear /> -->
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>收货经办人：</div>
                </div>
                <a-auto-complete v-model="itemData.shipper_agent" :data="tuoyunUserData" @blur="tuoyunUserSaveHistory" @search="handleTuoyunUserSearch" :style="{flex:1}" placeholder="请输入收货经办人"/>
                <!-- <a-input v-model="itemData.shipper_agent" :style="{flex:1}" placeholder="请输入收货经办人" allow-clear /> -->
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>收货电话：</div>
                </div>
                <a-auto-complete v-model="itemData.shipper_phone" :data="tuoyunPhoneData" @blur="tuoyunPhoneSaveHistory" @search="handleTuoyunPhoneSearch" :style="{flex:1}" placeholder="请输入收货电话"/>
                <!-- <a-input v-model="itemData.shipper_phone" :style="{flex:1}" placeholder="请输入收货电话" allow-clear /> -->
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>发站：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.sending_station" :options="sendList" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="车站：" @change="handleSendChange($event,1)" />
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.sending_tlj" :options="sendJuList" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="到/发局" />
                </div>
                
                
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>发站专用线：</div>
                </div>
                <a-input v-model="itemData.sending_station_special" :style="{flex:1}" placeholder="请输入发站专用线" allow-clear />
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>客户名称：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.dept_id" :options="props.dept_list" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择客户" @change="handleChangeDept" />
                </div>
                <div style="overflow: hidden; margin-left:10px; ">
                    <a-button type="primary" shape="circle"  @click="openAdd">
                        <icon-plus />
                    </a-button>
                    <!-- <a-button type="primary" @click="openAdd">新增客户</a-button> -->
                </div>
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>客户经办人：</div>
                </div>
                <a-auto-complete v-model="itemData.customer_handler" :data="kehuUserData" @blur="kehuUserSaveHistory" @search="handleKehuUserSearch" :style="{flex:1}" placeholder="请输入客户经办人"/>
                <!-- <a-input v-model="itemData.customer_handler" :style="{flex:1}" placeholder="请输入客户经办人" allow-clear /> -->
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>客户电话：</div>
                </div>
                <a-input v-model="itemData.customer_tel" :style="{flex:1}" placeholder="请输入客户电话" allow-clear />
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>到站：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.come_address" :options="sendList" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="车站：" @change="handleSendChange($event,2)" />
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.come_tlj" :options="arriveJuList" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="到/发局" />
                </div>
                
                
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>到站专用线：</div>
                </div>
                <a-input v-model="itemData.arrive_station_special" :style="{flex:1}" placeholder="请输入到站专用线" allow-clear />
            </div>
            <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>合同：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.contract_id" :options="contractList" :field-names="{ value: 'id', label: 'name' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择合同" @change="handlechangeadderr" />
                </div>
                <div style="overflow: hidden; margin-left:10px; ">
                    <a-button type="primary" shape="circle"  @click="saveHt">
                        <icon-plus />
                    </a-button>
                    <!-- <a-button type="primary" @click="saveHt">新增合同</a-button> -->
                </div>
            </div>
            <!-- <div class="jcBox flex align_center">
                <div class="flex justify_end" style="width: 100px;">
                    <div style="color: red;">*</div>
                    <div>是否仓储：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.serve_type" :options="props.fuwuList" :field-names="{ value: 'key', label: 'title' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择是否仓储" />
                </div>
                
            </div> -->
            <div class="jcBox flex align_center" v-if="itemData.service_type == 2 || itemData.service_type == 4">
                <div class="flex justify_end" style="width: 100px;">
                    
                    <div>送货电话：</div>
                </div>
                <a-input v-model="itemData.shipping_tel" :style="{flex:1}" placeholder="请输入送货电话" allow-clear />
            </div>
            <div class=" flex_1 flex align_center" style="margin-bottom: 12px;" v-if="itemData.service_type == 2 || itemData.service_type == 4">
                <div class="flex justify_end" style="width: 100px;">
                    <div>送货地址：</div>
                </div>
                <div class="flex_1" style="overflow: hidden;">
                    <a-select v-model="itemData.shipping_address" :options="peisongaddrrList" :field-names="{ value: 'id', label: 'address' }" :style="{width:'100%'}"
                    allow-clear allow-search placeholder="请选择送货地址" />
                </div>
                
            </div>
        </div>
        <div style="font-size: 18px;font-weight: 600;color: rgba(0, 0, 0, .6);margin-bottom: 16px;">{{itemData.transport_type == 1?'集装箱':itemData.transport_type == 2?'整车':'批量快运'}}运输方式</div>
        <!-- 集装箱运输方式 -->
        <div style="margin-bottom: 16px;">
            <a-table :scroll="{x:'100%'}" :data="boxData" :columns="boxColumns" :pagination="false" v-if="itemData.transport_type == 1" >
                <template #ticket_number="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.ticket_number" placeholder="原票号" allow-clear />
                    </div>
                    <div v-else  @click="handleAdd(record,rowIndex,1)">
                        <a-link><icon-plus /> 添加</a-link>
                    </div>
                </template>
                <template #goods_id="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-select v-model="record.goods_id" :options="props.goods_list" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择品名" @change="handleChangeGood" :disabled="rowIndex == 0?false:true" />
                    </div>
                    <div v-else></div>
                </template>
                <template #baozhuang="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-auto-complete v-model="record.baozhuang" :data="baozhuangData" @blur="baozhuangSaveHistory(rowIndex)" @search="handleBaozhuangSearch" :style="{flex:1}" placeholder="请输入包装"/>
                        <!-- <a-input style="width: 100%;" v-model="record.baozhuang" placeholder="包装" allow-clear /> -->
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #box="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.box" placeholder="箱号" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #is_empty="{ record }">
                    <div v-if="record.type == 1">
                        <a-select v-model="record.is_empty" :options="is_emptyList" :field-names="{ value: 'key', label: 'title' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择空/重状态" />
                    </div>
                    <div v-else></div>
                </template>
                <template #box_type_id="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-select v-model="record.box_type_id" :options="boxTypeList" :field-names="{ value: 'id', label: 'name' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择类型" @change="handleChangeBoxType($event,rowIndex)" />
                    </div>
                    <div v-else></div>
                </template>
                <template #box_belong="{ record }">
                    <div v-if="record.type == 1">
                        <a-select v-model="record.box_belong" :options="box_belongList" :field-names="{ value: 'key', label: 'title' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择箱属" />
                    </div>
                    <div v-else></div>
                </template>
                <template #number_yu="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.number_yu" placeholder="件数" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #bz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.bz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #hz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.hz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #jf_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.jf_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #cyr_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.cyr_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #size="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.size" placeholder="体积" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #caozuo="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <div @click="handleDel(rowIndex,1)"> <a-link>删除</a-link></div>
                    </div>
                    <div v-else>
                    </div>
                </template>
            </a-table>
            <!-- 整车运输方式 -->
            <a-table :scroll="{x:'100%'}" :data="zhengcheData" :columns="zhengcheColumns" :pagination="false" v-if="itemData.transport_type == 2" >
                <template #ticket_number="{ record,rowIndex }">
                    <div >
                        <a-input style="width: 100%;" v-model="record.ticket_number" placeholder="原票号" allow-clear />
                    </div>
                    <!-- <div v-else  @click="handleAdd(rowIndex,2)">
                        <a-link><icon-plus /> 添加</a-link>
                    </div> -->
                </template>
                <template #goods_id="{ record }">
                    <div v-if="record.type == 1">
                        <a-select  v-model="record.goods_id" :options="props.goods_list" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择品名" />
                    </div>
                    <div v-else></div>
                </template>
                <template #baozhuang="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-auto-complete v-model="record.baozhuang" :data="baozhuangData" @blur="baozhuangSaveHistory(rowIndex)" @search="handleBaozhuangSearch" :style="{flex:1}" placeholder="请输入包装"/>
                        <!-- <a-input style="width: 100%;" v-model="record.baozhuang" placeholder="包装" allow-clear /> -->
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #number_yu="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.number_yu" placeholder="件数" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #bz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.bz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #hz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.hz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #jf_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.jf_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #cyr_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.cyr_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                
                <!-- <template #caozuo="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <div @click="handleDel(rowIndex,2)"> <a-link>删除</a-link></div>
                    </div>
                    <div v-else>
                    </div>
                </template> -->
            </a-table>
            <!-- 批量快运运输方式 -->
            <a-table :scroll="{x:'100%'}" :data="plkyData" :columns="plkyColumns" :pagination="false" v-if="itemData.transport_type == 4" >
                <template #ticket_number="{ record,rowIndex }">
                    <div >
                        <a-input style="width: 100%;" v-model="record.ticket_number" placeholder="原票号" allow-clear />
                    </div>
                    <!-- <div v-else  @click="handleAdd(rowIndex,3)">
                        <a-link><icon-plus /> 添加</a-link>
                    </div> -->
                </template>
                <template #goods_id="{ record }">
                    <div v-if="record.type == 1">
                        <a-select  v-model="record.goods_id" :options="props.goods_list" :filter-option="filterOption" :field-names="{ value: 'id', label: 'name' }" style="width:100%"
                        allow-clear allow-search placeholder="请选择品名" />
                    </div>
                    <div v-else></div>
                </template>
                <template #baozhuang="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <a-auto-complete v-model="record.baozhuang" :data="baozhuangData" @blur="baozhuangSaveHistory(rowIndex)" @search="handleBaozhuangSearch" :style="{flex:1}" placeholder="请输入包装"/>
                        <!-- <a-input style="width: 100%;" v-model="record.baozhuang" placeholder="包装" allow-clear /> -->
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #number_yu="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.number_yu" placeholder="件数" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #bz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.bz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #hz_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.hz_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #jf_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.jf_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #cyr_weight="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.cyr_weight" placeholder="重量" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <template #size="{ record }">
                    <div v-if="record.type == 1">
                        <a-input style="width: 100%;" v-model="record.size" placeholder="体积" allow-clear />
                    </div>
                    <div v-else>
                    </div>
                </template>
                <!-- <template #caozuo="{ record,rowIndex }">
                    <div v-if="record.type == 1">
                        <div @click="handleDel(rowIndex,3)"> <a-link>删除</a-link></div>
                    </div>
                    <div v-else>
                    </div>
                </template> -->
            </a-table>
        </div>
        <div class="flex justify_end">
            <a-button type="primary" style="margin-right: 12px;" @click="handleBaoCun(2)">保存并生成账单</a-button>
            <a-button type="primary" @click="handleBaoCun(1)">保存</a-button>
        </div>

        <!-- 确认账单 -->
        <a-modal :mask-closable="false"  v-model:visible="showBill" title="确认账单" @cancel="showBill = false" :width="1400" :footer="false">
        <bill ref="billRef" v-if="showBill" :item="billData" :type="2" @quxiao="showBill = false" @shuaxin="zhangdanshuaxin"></bill>
        </a-modal>

        <!-- 新增/编辑 -->
        <a-modal :mask-closable="false"  v-model:visible="visible_Add" :width="1080" @cancel="visible_Add=false" :on-before-ok="handleAddOk">
            <template #title>
                新增
            </template>
            <div class="contenBox" style="overflow: auto;height: 700px;">
            <div style="margin-bottom: 16px">
                <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                <template #title>
                    <div style="color:rgba(0, 82, 217, 1);font-weight:600">基本信息</div>
                </template>
                <div class="flex marbot24 align_center" style="width:100%" >
                    <div class="flex align_center" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div class="font14 ">类型：</div>
                    <div class="flex align_center" style="height:32px">
                        <a-space size="large">
                        <a-radio-group v-model="addItem.type" :options="typeList" @change="handleType" />
                        </a-space>
                    </div>
                    </div>
                    <div  class="flex align_center" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div  class="font14 ">客户类型：</div>
                    <div class="flex align_center" style="height:32px">
                        <a-space size="large">
                        <a-radio-group v-model="addItem.customer_type" :options="customerTypeList" />
                        </a-space>
                    </div>
                    </div>
                    <div class="flex align_center" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div class="font14 ">状态：</div>
                    <div class="flex align_center" style="height:32px">
                        <a-space size="large">
                        <a-radio-group v-model="addItem.status" :options="statusList" />
                        </a-space>
                    </div>
                    </div>
                </div>
                <div class="flex marbot24 align_center" style="width:100%" v-if="addItem.customer_type == 1">
                    <div  style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4 flex align_center"><div style="color: red;">*</div>客户名称：</div>
                    <a-select style="flex:1" :loading="loading" placeholder="请选择客户名称" v-model="addItem.name"
                                @search="handleSearch" :filter-option="false" @change='handleYinhanInfo($event)'  allow-search >
                        <a-option v-for="item of deptSearchList" :value="item.creditNo" >{{item.companyName}}</a-option>
                    </a-select>
                    <!-- <a-input v-model="addItem.name" placeholder="请输入客户名称" allow-clear @change="handleKehuInfo" /> -->
                    </div>
                    <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                    <div class="font14 marbot4">负责人:</div>
                    <a-input v-model="addItem.leader" placeholder="请输入负责人" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4 flex align_center"><div style="color: red;">*</div>联系电话:</div>
                    <a-input v-model="addItem.phone" placeholder="请输入联系电话" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4">邮箱:</div>
                    <a-input v-model="addItem.e_mail" placeholder="请输入邮箱" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                    <div class="font14 marbot4">纳税人识别号:</div>
                    <a-input v-model="addItem.card_id" placeholder="请输入纳税人识别号" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4">标签组:</div>
                    <a-select v-model="addItem.tag_ids"  placeholder="请选择标签" multiple>
                        <a-option v-for="item of tagList" :value="item.id" :label="item.name" />
                    </a-select>
                    </div>
                </div>
                <div class="flex marbot24 align_center" style="width:100%" v-if="addItem.customer_type == 2">
                    <div  style="margin-right:36px;width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4">客户名称：</div>
                    <a-input v-model="addItem.name" placeholder="请输入客户名称" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                    <div class="font14 marbot4">联系电话:</div>
                    <a-input v-model="addItem.phone" placeholder="请输入联系电话" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4">邮箱:</div>
                    <a-input v-model="addItem.e_mail" placeholder="请输入邮箱" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 2">
                    <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                    <div class="font14 marbot4">身份证号:</div>
                    <a-input v-model="addItem.card_id" placeholder="请输入身份证号" allow-clear  />
                    </div>
                    <div style="width:calc((100% - 72px) / 3);">
                    <div class="font14 marbot4">标签组:</div>
                    <a-select v-model="addItem.tag_ids"  placeholder="请选择标签" multiple>
                        <a-option v-for="item of tagList" :value="item.id" :label="item.name" />
                    </a-select>
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%">
                    <div style="width:100%;">
                    <div class="font14 marbot4">营业执照：</div>
                    <ma-upload v-model="addItem.file" type='image' />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%">
                    <div style="width:100%;">
                    <div class="font14 marbot4">备注:</div>
                    <a-textarea placeholder="请输入备注" v-model="addItem.remark" allow-clear/>
                    </div>
                </div>
                </a-card>
            </div>
            <div style="margin-bottom: 16px">
                <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                <template #title>
                    <div style="color:rgba(0, 82, 217, 1);font-weight:600">工商信息</div>
                </template>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">公司名称：</div>
                    <a-input v-model="addItem.company_data.companyName" placeholder="请输入公司名称" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">公司类型：</div>
                    <a-input v-model="addItem.company_data.companyType" placeholder="请输入公司类型" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">法定代表人：</div>
                    <a-input v-model="addItem.company_data.legalPerson" placeholder="请输入法定代表人" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">法人类型：</div>
                    <a-input v-model="addItem.company_data.legalPersonType" placeholder="请输入法人类型" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">电话号码：</div>
                    <a-input v-model="addItem.company_data.phoneNumber" placeholder="请输入电话号码" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">电话备注：</div>
                    <a-input v-model="addItem.company_data.phoneNumber_note" placeholder="请输入电话备注" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">注册资本：</div>
                    <a-input v-model="addItem.company_data.capital" placeholder="请输入注册资本" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">实收注册资金：</div>
                    <a-input v-model="addItem.company_data.realCapital" placeholder="请输入实收注册资金" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">注册码：</div>
                    <a-input v-model="addItem.company_data.companyCode" placeholder="请输入注册码" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">企业信用代码：</div>
                    <a-input v-model="addItem.company_data.creditNo" placeholder="请输入企业信用代码" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">组织机构代码：</div>
                    <a-input v-model="addItem.company_data.orgCode" placeholder="请输入组织机构代码" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">经营范围：</div>
                    <a-input v-model="addItem.company_data.businessScope" placeholder="请输入经营范围" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">登记机关：</div>
                    <a-input v-model="addItem.company_data.authority" placeholder="请输入登记机关" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">经营状态：</div>
                    <a-input v-model="addItem.company_data.companyStatus" placeholder="请输入经营状态" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">成立时间：</div>
                    <a-input v-model="addItem.company_data.establishDate" placeholder="请输入成立时间" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">营业开始时间：</div>
                    <a-input v-model="addItem.company_data.operationStartdate" placeholder="请输入营业开始时间" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">营业结束时间：</div>
                    <a-input v-model="addItem.company_data.operationEnddate" placeholder="请输入营业结束时间" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">核准日期：</div>
                    <a-input v-model="addItem.company_data.issueDate" placeholder="请输入核准日期" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">省份：</div>
                    <a-input v-model="addItem.company_data.province" placeholder="请输入省份" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">省份行政区号：</div>
                    <a-input v-model="addItem.company_data.provinceCode" placeholder="请输入省份行政区号" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">地市：</div>
                    <a-input v-model="addItem.company_data.city" placeholder="请输入地市" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">地市行政区号：</div>
                    <a-input v-model="addItem.company_data.cityCode" placeholder="请输入地市行政区号" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">地区：</div>
                    <a-input v-model="addItem.company_data.district" placeholder="请输入地区" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">地区行政区号：</div>
                    <a-input v-model="addItem.company_data.districtCode" placeholder="请输入地区行政区号" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">注册地址：</div>
                    <a-input v-model="addItem.company_data.companyAddress" placeholder="请输入注册地址" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">行业：</div>
                    <a-input v-model="addItem.company_data.industry" placeholder="请输入行业" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">曾用名：</div>
                    <a-input v-model="addItem.company_data.historyNames" placeholder="请输入曾用名" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">更新时间：</div>
                    <a-input v-model="addItem.company_data.lastUpdatedTime" placeholder="请输入更新时间" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">登记状态：</div>
                    <a-input v-model="addItem.company_data.companyStatus" placeholder="请输入登记状态" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">邮箱：</div>
                    <a-input v-model="addItem.company_data.email" placeholder="请输入邮箱" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">邮箱备注：</div>
                    <a-input v-model="addItem.company_data.email_note" placeholder="请输入邮箱备注" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">地址：</div>
                    <a-input v-model="addItem.company_data.address" placeholder="请输入地址" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    <div class="font14 marbot4" style="width: 100px;">地址备注：</div>
                    <a-input v-model="addItem.company_data.address_note" placeholder="请输入地址备注" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 1">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">网址：</div>
                    <a-input v-model="addItem.company_data.website" placeholder="请输入网址" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;margin-right:36px;" >
                    <div class="font14 marbot4" style="width: 100px;">网址备注：</div>
                    <a-input v-model="addItem.company_data.website_note" placeholder="请输入网址备注" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;" >
                    
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%" v-if="addItem.customer_type == 2">
                    <div class="flex align_center" style="flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">抬头名称：</div>
                    <a-input v-model="addItem.companyName" placeholder="请输入抬头名称" allow-clear  />
                    </div>
                </div>
                </a-card>
            </div>
            <div >
                <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                <template #title>
                    <div style="color:rgba(0, 82, 217, 1);font-weight:600">银行账户信息</div>
                </template>
                <div class="flex marbot24" style="width:100%">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">开户银行：</div>
                    <a-input v-model="addItem.opening_bank" placeholder="请输入开户银行" allow-clear  />
                    </div>
                    <div class="flex align_center" style="flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">银行账号：</div>
                    <a-input v-model="addItem.account" placeholder="请输入银行账号" allow-clear  />
                    </div>
                </div>
                <div class="flex marbot24" style="width:100%">
                    <div class="flex align_center" style="margin-right:36px;flex:1;">
                    <div class="font14 marbot4" style="width: 100px;">账户名称：</div>
                    <a-input v-model="addItem.account_name" placeholder="请输入账户名称" allow-clear  />
                    </div>
                    <div style="flex:1;">
                    
                    </div>
                </div>
                </a-card>
            </div>
            </div>
        </a-modal>

        <!-- 新增合同 -->
        <a-modal :mask-closable="false"  v-model:visible="showSaveHt" title="新增合同" @cancel="showSaveHt = false" :width="800" :footer="false">
            <div class="contenBox" style="overflow: auto;">
                <ma-form v-model="saveHtform" :columns="saveHtColumns" ref="saveHtFormRef" @submit="saveHtSub" v-if="showSaveHt" />
            </div>
        </a-modal>
    </div>
    
</template>




<script setup>
    import { ref, reactive, onMounted, onActivated, defineProps,shallowRef } from "vue";
    import predictionManage from "@/api/prediction/predictionManage";
    import commonApi from "@/api/common";
    import htgsComponent from "./htgsComponent.vue";
    import bill from "@/components/bill/index.vue"
    import { request } from "@/utils/request.js";
    import { Message } from "@arco-design/web-vue";
    import { pinyin } from "pinyin-pro"
    import tool from '@/utils/tool'
    const emits = defineEmits(['succ'])
    const props = defineProps({
        dept_list:{
            default:[]
        },
        yunshuList:{
            default:[]
        },
        goods_list:{
            default:[]
        },
        fuwuList:{
            default:[]
        },
        item:{
            default:{}
        }
    })
    const showBill = ref(false)
    const loading = ref(false)
    const deptSearchList = ref([])
    // 新增合同
    const showSaveHt = ref(false)
    const saveHtFormRef = ref(false)
    const saveHtform = ref({})
    const saveHtColumns = reactive([
		{
			title: "合同名称",
			dataIndex: "name",
			formType: "input",
			width:180,
			align: "center",
			search: true,
			commonRules: {
				required: true,
				message: "请输入合同名称",
			},
		},
		{
			title: "合同号",
			dataIndex: "contract_no",
			formType: "input",
			align: "center",
			width:180,
			search: true,
			commonRules: {
				required: true,
				message: "请输入合同号",
			},
		},
		{
			title: "合同公司",
			dataIndex: "dept_id",
			align: "center",
			formType: "component",
			component: shallowRef(htgsComponent),
			// width:180,
			search: true,
			// dict: {
			// 	// 远程通用接口请求，新版代码生成都有一个 remote 接口
			// 	remote: "system/dept/remote",
			// 	// 指定组件接收的props
			// 	props: { label: "name", value: "id" },
			// 	// 开启分页
			// 	openPage: false,
			// 	// 远程请求配置项
			// 	remoteOption: {
			// 		// 按用户名排序
			// 		sort: { id: "desc" }, // 如果不指定排序方式，默认为正序排序
			// 		// 设置查询的字段
			// 		select: ["id", "name"],
			// 		// 设置数据过滤
			// 		filter: {
			// 			type: ["=", 2],
			// 		},
			// 		// 关联模型
			// 		relations: [],
			// 	},
			// },
			commonRules: {
				required: true,
				message: "请选择合同公司",
			},
		},
		{ title: '免费堆放天数', dataIndex: 'zc_day',  align:'center',width: 120,formType:'input' },
		{
			
			dataIndex: "charge_type",
			formType: "radio",
			title: "计费政策",
			align: "center",
			hide:true,
			control: (val) => {
				if (val == 1) {
					return {
						template_id: { display: true },
					}
				}
				if (val == 2) {
					return {
						template_id: { display: false },
					}
				}
			},
			dict: {
				data()
				{
				return [
					{label: "公示价格", value: 1},
					{label: "一企一策", value: 2},
				]
				},
				translation: true
			},
			commonRules: {
				required: true,
				message: "请选择计费政策"
			},
			
		},
		{
			title: "计费模版",
			dataIndex: "template_id",
			align: "center",
			formType: "select",
			width:180,
			display:false,
			editDisplay:false,
			hide:true,
			dict: {
				// 远程通用接口请求，新版代码生成都有一个 remote 接口
				url: "system/template/index",
				method:'GET',
				// 指定组件接收的props
				props: { label: "name", value: "id" },
				// 开启分页
				openPage: false,
				// 远程请求配置项
				remoteOption: {
					// 设置查询的字段
					select: ["id", "name"],
					// 关联模型
					relations: [],
				},
			},
			commonRules: {
				required: true,
				message: "请选择计费模版",
			},
		},
		{
			title: "合同附件",
			dataIndex: "annex",
			align: "center",
			formType: "upload",
			type: "file",
			multiple: true,
			returnType: "url",
		},
		{
			title: "开始时间",
			dataIndex: "start_time",
			align: "center",
			formType: "date",
			search: false,
			addDisabled:false,
			editDisabled:true,
			showTime: true,
			commonRules: {
				required: true,
				message: "请选择开始时间"
			},
		},
		{
			title: "结束时间",
			dataIndex: "end_time",
			align: "center",
			formType: "date",
			addDisabled:false,
			editDisabled:true,
			search: false,
			showTime: true,
			disabledDate:(current) => {
				// return true

				let newData = new Date(current).getTime()    //  每一天的时间戳
				let newDatas = new Date(saveHtFormRef.value.getFormData().start_time).getTime()    //  开始时间戳
				if(newData < newDatas){
					return true
				}else{
					return false
				}
				
				
			},
			commonRules: {
				required: true,
				message: "请选择结束时间"
			}
		},
    {
      title: "结算方式",
      dataIndex: "pay_method",
      align: "center",
      formType: "checkbox",
	  width:180,
      addDefaultValue: 1,
    //   search: true,
      commonRules: {
        required: true,
        message: "请选择支付方式",
      },
      dict: {
        data: [
          {label: '预付', value: '1'},
          {label: '周期结算', value: '2'},
          {label: '现结', value: '3'},
        ],
        translation: true,
      },
    }
	]);
    const saveHt = () => {
        showSaveHt.value = true
    }
    const saveHtSub = (data,done) => {
        let subData = saveHtform.value
        subData.pay_method = subData.pay_method.join(",")
        if (data) {
            systemUserContract.save(subData).then( res => {
                if (res.code == 200 && res.success) {
                    Message.success('提交成功')
                    showSaveHt.value = false
                    saveHtFormRef.value.resetForm()
                    if(!itemData.value.dept_id){
                        return
                    }
                    request({
                        url: 'system/userContract/remote_prediction?dept_id=' + itemData.value.dept_id,
                        method: 'get',
                        params: {
                            pageSize: 1000,
                        }
                    }).then(res => {
                        contractList.value = res.data
                        if(res.data.length == 1){
                            itemData.value.contract_id = res.data[0].id
                            handlechangeadderr(res.data[0].id)
                        }
                    })
                    dept_list.value.map((v,i)=>{
                        if(v.id == itemData.value.dept_id){
                            itemData.value.customer_handler = v.leader
                            itemData.value.customer_tel = v.phone
                        }
                    })



                }
            }).catch( e => {
                console.error(e)
                Message.error('提交失败')
            })
        }
    }
    const visible_Add = ref(false)
    const typeList = ref([
        {label:'园区企业',value:1},
        {label:'用户企业',value:2},
    ])
    const customerTypeList = ref([
        {label:'企业',value:1},
    ])
    const statusList= ref([
        {label:'正常',value:1},
        {label:'停用',value:2},
    ])
    const addItem = ref({
        type:1,
        customer_type:1,
        status:1,
        name:'',
        leader:'',
        phone:'',
        e_mail:'',
        card_id:'',
        file:'',
        tag_ids:[],
        remark:'',
        // 工商信息
        company_data:{
        companyName:'',  // 公司名称
        companyType:'',  // 公司类型
        legalPerson:'',  // 法定代表人
        legalPersonType:'',  //  法人类型
        phoneNumber:'',   // 电话号码
        phoneNumber_note:'',   // 电话备注
        capital:'',       // 注册资本
        realCapital:'',   // 实收注册资金
        companyCode:'',  // 注册码
        creditNo:'',  // 企业信用代码
        orgCode:'',   // 组织机构代码
        businessScope:'',  // 经营范围
        authority:'',  // 登记机关
        companyStatus:'',   // 经营状态
        establishDate:'',  // 成立时间
        operationStartdate:'',  // 营业期限开始时间
        operationEnddate:'',  // 营业期限结束时间
        issueDate:'',  // 核准日期
        province:'',  // 省份
        provinceCode:'',   // 省份行政区号
        city:'',   // 地市
        cityCode:'',  // 地市行政区号
        district:'', // 地区
        districtCode:'',  // 地区行政区号
        companyAddress:'',  // 注册地址
        industry:'',  // 行业
        historyNames:'', // 曾用名
        lastUpdatedTime:'',  // 更新时间
        companyStatus:'',  // 登记状态
        email:'',   // 邮箱
        email_note:'',  // 邮箱备注
        address:'',  // 地址
        address_note:'',   // 地址备注
        website:'',  // 网址
        website_note:'', // 网址备注
        },
        


        // 银行信息
        opening_bank:'', // 开户行
        account:'', // 收款账户
        account_name:'', // 开户名称
    })
    const billData = ref({})
    const serviceList = ref([
        {
            title:'站到站',
            key:'1'
        },
        {
            title:'站到门',
            key:'2'
        },
        {
            title:'门到站',
            key:'3'
        },
        {
            title:'门到门',
            key:'4'
        },
        
    ])
    const is_emptyList = ref([
        {
            title:'空箱',
            key:'1'
        },
        {
            title:'重箱',
            key:'2'
        },
    ])
    const box_belongList = ref([
        { key: '铁路箱', title: "铁路箱" },
        { key: '自备箱', title: "自备箱" },
    ])
    const sendList = ref([])   // 站列表
    const sendJuList = ref([])   // 发站局列表
    const arriveJuList = ref([])   // 到站局列表
    const contractList = ref([])   // 合同列表
    const peisongaddrrList = ref([])   // 配送地址
    const boxTypeList = ref([])
    const itemData = ref({
        car_type:'',  // 车种
        car_no:'',  // 车号
        
        process_time:tool.dateFormat(
			Math.round(new Date().getTime() / 1000).toString(),
			"yyyy-MM-dd"
		),  // 办理时间
        transport_type:'1',  // 运输方式
        service_type:'',  //  服务方式
        shipper:'',   // 托运人
        shipper_agent:'',   // 托运经办人
        shipper_phone:'',   // 托运人电话
        sending_station:'',   // 发站
        sending_tlj:'',   // 发 铁路局
        sending_station_special:'四川威斯腾物流有限公司专用线',  // 发站专用线
        come_address:'',   // 到站
        come_tlj:'',   // 到 铁路局
        arrive_station_special:'',  // 到站专用线
        dept_id:'',   // 客户
        customer_handler:'',   // 客户经办人
        customer_tel:'',    // 客户电话
        contract_id:'',   // 合同
        serve_type:'3',   // 是否仓储
        shipping_tel:'',   // 配送电话
        shipping_address:'',   // 配送地址
        type:"2",
    })
    const carTypeData = ref([])
    const handleCarTypeSearch = (value)=>{
        // carTypeData.value = carTypeData.value.filter(item => item.includes(value));
    }
    const carTypeSaveHistory = ()=>{
        const value = itemData.value.car_type.trim();
        if (value && !carTypeData.value.includes(value)) {
            carTypeData.value = [value, ...carTypeData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('car_type', JSON.stringify(carTypeData.value));
        }
    }
    const tuoyunData = ref([])
    const handleTuoyunSearch = (value)=>{
        // tuoyunData.value = tuoyunData.value.filter(item => item.includes(value));
    }
    const tuoyunSaveHistory = ()=>{
        const value = itemData.value.shipper.trim();
        if (value && !tuoyunData.value.includes(value)) {
            tuoyunData.value = [value, ...tuoyunData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('tuoyun', JSON.stringify(tuoyunData.value));
        }
    }
    const tuoyunUserData = ref([])
    const handleTuoyunUserSearch = (value)=>{
        // tuoyunUserData.value = tuoyunUserData.value.filter(item => item.includes(value));
    }
    const tuoyunUserSaveHistory = ()=>{
        const value = itemData.value.shipper_agent.trim();
        if (value && !tuoyunUserData.value.includes(value)) {
            tuoyunUserData.value = [value, ...tuoyunUserData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('tuoyunUser', JSON.stringify(tuoyunUserData.value));
        }
    }
    const tuoyunPhoneData = ref([])
    const handleTuoyunPhoneSearch = (value)=>{
        // tuoyunPhoneData.value = tuoyunPhoneData.value.filter(item => item.includes(value));
    }
    const tuoyunPhoneSaveHistory = ()=>{
        const value = itemData.value.shipper_phone.trim();
        if (value && !tuoyunPhoneData.value.includes(value)) {
            tuoyunPhoneData.value = [value, ...tuoyunPhoneData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('tuoyunPhone', JSON.stringify(tuoyunPhoneData.value));
        }
    }
    const kehuUserData = ref([])
    const handleKehuUserSearch = (value)=>{
        // kehuUserData.value = kehuUserData.value.filter(item => item.includes(value));
    }
    const kehuUserSaveHistory = ()=>{
        const value = itemData.value.customer_handler.trim();
        if (value && !kehuUserData.value.includes(value)) {
            kehuUserData.value = [value, ...kehuUserData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('kehuUser', JSON.stringify(kehuUserData.value));
        }
    }
    const baozhuangData = ref([])
    const handleBaozhuangSearch = (value)=>{
        // baozhuangData.value = baozhuangData.value.filter(item => item.includes(value));
    }
    const baozhuangSaveHistory = (index)=>{
        const value = boxData.value[index].baozhuang.trim();
        if (value && !baozhuangData.value.includes(value)) {
            baozhuangData.value = [value, ...baozhuangData.value].slice(0, 10); // 最多保留10条
            localStorage.setItem('baozhuang', JSON.stringify(baozhuangData.value));
        }
    }
    const filterOption = (v,option)=>{
        return option.keywords.some(keywords=>keywords.includes(v))
    }
    const handleAddOk = async ()=>{
        let res = await dept.save(addItem.value)
        if(res.code == 200){
            Message.success('添加成功')
            setTimeout(function(){
                handleDeptList()
            },500)
            return true
        }else{
            Message.error(res.message)
            return false
        }
        
    }
    const openAdd = () => {
        addItem.value = {
            type:1,
            customer_type:1,
            status:1,
            name:'',
            leader:'',
            phone:'',
            e_mail:'',
            card_id:'',
            file:'',
            tag_ids:[],
            remark:'',
            company_data:{
            companyName:'',  // 公司名称
            companyType:'',  // 公司类型
            legalPerson:'',  // 法定代表人
            legalPersonType:'',  //  法人类型
            phoneNumber:'',   // 电话号码
            phoneNumber_note:'',   // 电话备注
            capital:'',       // 注册资本
            realCapital:'',   // 实收注册资金
            companyCode:'',  // 注册码
            creditNo:'',  // 企业信用代码
            orgCode:'',   // 组织机构代码
            businessScope:'',  // 经营范围
            authority:'',  // 登记机关
            companyStatus:'',   // 经营状态
            establishDate:'',  // 成立时间
            operationStartdate:'',  // 营业期限开始时间
            operationEnddate:'',  // 营业期限结束时间
            issueDate:'',  // 核准日期
            province:'',  // 省份
            provinceCode:'',   // 省份行政区号
            city:'',   // 地市
            cityCode:'',  // 地市行政区号
            district:'', // 地区
            districtCode:'',  // 地区行政区号
            companyAddress:'',  // 注册地址
            industry:'',  // 行业
            historyNames:'', // 曾用名
            lastUpdatedTime:'',  // 更新时间
            companyStatus:'',  // 登记状态
            email:'',   // 邮箱
            email_note:'',  // 邮箱备注
            address:'',  // 地址
            address_note:'',   // 地址备注
            website:'',  // 网址
            website_note:'', // 网址备注
            },
            
            opening_bank:'', // 开户行
            account:'', // 收款账户
            account_name:'', // 开户名称
        }
        customerTypeList.value = [
            {label:'企业',value:1},
        ]
        visible_Add.value = true
    }
    const handleSearch = (value) => {
        if (value) {
        loading.value = true;
        request({
            url:'system/dept/info',
            method: 'get',
            params:{
            keyword:value,
            pageNo:1,
            pageSize:1000,
            },
        }).then(res=>{
            console.log('公司信息：',res)
            deptSearchList.value = res.data.items
            loading.value = false;
        })
        } else {
        deptSearchList.value = []
        }
    };
    const handleYinhanInfo = (e)=>{
        console.log(e)
        deptSearchList.value.map((v,i)=>{
        if(v.creditNo == e){
            addItem.value.name = v.companyName
        }
        })
        request({
        url:'system/dept/getCompanyDetail',
        method: 'get',
        params:{
            keyword:e,
            
        },
        }).then(res=>{
        console.log('银行信息：',res)
        let _data = res.data
        addItem.value.company_data.companyType = _data.companyType
        addItem.value.company_data.legalPersonType = _data.legalPersonType
        addItem.value.company_data.phoneNumber = _data.contacts.phoneNumber[0].value || ''
        addItem.value.company_data.phoneNumber_note = _data.contacts.phoneNumber[0].note  || ''
        addItem.value.company_data.capital = _data.capital
        addItem.value.company_data.realCapital = _data.realCapital
        addItem.value.company_data.orgCode = _data.orgCode
        addItem.value.company_data.businessScope = _data.businessScope
        addItem.value.company_data.authority = _data.authority
        addItem.value.company_data.operationStartdate = _data.operationStartdate
        addItem.value.company_data.operationEnddate = _data.operationEnddate
        addItem.value.company_data.issueDate = _data.issueDate
        addItem.value.company_data.province = _data.province
        addItem.value.company_data.provinceCode = _data.provinceCode
        addItem.value.company_data.city = _data.city
        addItem.value.company_data.cityCode = _data.cityCode
        addItem.value.company_data.district = _data.district
        addItem.value.company_data.districtCode = _data.districtCode
        addItem.value.company_data.industry = _data.industry
        addItem.value.company_data.historyNames = _data.historyNames
        addItem.value.company_data.lastUpdatedTime = _data.lastUpdatedTime
        addItem.value.company_data.email = _data.contacts.email[0].value || ''
        addItem.value.company_data.email_note = _data.contacts.email[0].note  || ''
        addItem.value.company_data.address = _data.contacts.address[0].value  || ''
        addItem.value.company_data.address_note = _data.contacts.address[0].note || ''
        addItem.value.company_data.website = _data.contacts.website[0].value || ''
        addItem.value.company_data.website_note = _data.contacts.website[0].note || ''
        console.log(addItem.value)
        })
    }
    const handleDeptList = () => {   //  获取公司列表
        request({
            url: 'system/dept/index',
            method: 'get',
            data: {
            openPage: false,
            remoteOption: {
                filter: {
                type: ['=', 2],
                status: ["=",1]
                },
                select: ["id", "name"],
                sort: { id: "desc" }
            }
            }
        }).then(res => {
            let arr = []
            res.data.map((v,i)=>{
                v.keywords = [
                v.name,
                pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join(''),
                pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join('').toUpperCase()
                ]
                if(v.status == 1){
                arr.push(v)
                }
            })
            dept_list.value = arr
        })
    }
    onMounted(()=>{
        console.log("props:",props.item)
        request({
            url: 'prediction/dfz/index',
            method: 'get',
            params: {
                pageSize: 1000,
            }
        }).then(res => {
            res.data.items.map((v,i)=>{
                    v.keywords = [
                    v.name,
                    pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join(''),
                    pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join('').toUpperCase()
                    ]
            })
            sendList.value = res.data.items
            sendList.value = res.data.items
            if(props.item.sending_station != ""){
                sendList.value.map((v,i)=>{
                    if(v.id == props.item.sending_station){
                        console.log(props.item.sending_tlj,99999)
                        sendJuList.value = [v.tlj]
                    }
                })
            }
            if(props.item.come_address != ""){
                sendList.value.map((v,i)=>{
                    if(v.id == props.item.come_address){
                        arriveJuList.value = [v.tlj]
                    }
                })
            }
            if(props.item.dept_id != ""){
                handleChangeDept(props.item.dept_id)
            }
            if(props.item.contract_id != ""){
                handlechangeadderr(props.item.contract_id)
            }
            
            if(props.item.goods_data.length != []){
                let boxArr = JSON.parse(JSON.stringify(props.item.goods_data))
                boxArr.map((v,i)=>{
                    v.type = 1
                })
                boxArr.push(
                    {
                        ticket_number:'',  
                        goods_id:'',  
                        baozhuang:'',  
                        box:'',  
                        is_empty:'2',  
                        box_type:'',  
                        box_type_id:'',  
                        box_belong:'',
                        number:'',  
                        hz_weight:'',  
                        bz_weight:'',  
                        jf_weight:'',  
                        cyr_weight:'',  
                        size:'',
                        caozuo:'',
                        type:2
                    }
                )
                if(props.item.transport_type == 1){
                    boxData.value = boxArr
                }else if(props.item.transport_type == 2){
                    zhengcheData.value = boxArr
                }else if(props.item.transport_type == 4){
                    plkyData.value = boxArr	
                }
            }
            console.log(boxData.value)
        })
        
        request({
            url: "prediction/boxManage/index",
            method: "get",
            params: {
            openPage: false,
            },
        }).then((res) => {
            boxTypeList.value = res.data.items;

        });
        const tuoyunHistory = localStorage.getItem('tuoyun');
        tuoyunData.value = tuoyunHistory ? JSON.parse(tuoyunHistory) : [];
        const savedHistory = localStorage.getItem('tuoyunUser');
        tuoyunUserData.value = savedHistory ? JSON.parse(savedHistory) : [];
        const phoneHistory = localStorage.getItem('tuoyunPhone');
        tuoyunPhoneData.value = phoneHistory ? JSON.parse(phoneHistory) : [];
        const kehuUserHistory = localStorage.getItem('kehuUser');
        kehuUserData.value = kehuUserHistory ? JSON.parse(kehuUserHistory) : [];
        const baozhuangHistory = localStorage.getItem('baozhuang');
        baozhuangData.value = baozhuangHistory ? JSON.parse(baozhuangHistory) : [];
        const carTypeHistory = localStorage.getItem('car_type');
        carTypeData.value = carTypeHistory ? JSON.parse(carTypeHistory) : [];
        itemData.value = JSON.parse(JSON.stringify(props.item))
    })
    const handleChangeDept = (e) =>{
        request({
            url: 'system/userContract/remote_prediction?dept_id=' + e,
            method: 'get',
            params: {
                pageSize: 1000,
            }
        }).then(res => {
            contractList.value = res.data
            if(res.data.length == 1){
                itemData.value.contract_id = res.data[0].id
                handlechangeadderr(res.data[0].id)
            }
        })
        props.dept_list.map((v,i)=>{
            if(v.id == e){
                itemData.value.customer_handler = v.leader
                itemData.value.customer_tel = v.phone
            }
        })
    }
    const handleChangeGood = (e)=>{
        boxData.value.map((v,i)=>{
            v.goods_id = e
        })
    }
    const handlechangeadderr = (e) =>{   // 获取合同配送地址
        request({
            url: '/system/userContractAddress/index?contract_id=' + e,
            method: 'get',
        }).then(res=>{
            if(res.data.items.length != 0){
                itemData.value.shipping_address = res.data.items[0].id
                itemData.value.shipping_tel = res.data.items[0].mobile
            }
            peisongaddrrList.value = res.data.items
        })
    }
    const handleSendChange = (e,type)=>{
        if(type == 1){
            sendList.value.map((v,i)=>{
                if(v.id == e){
                    sendJuList.value = [v.tlj]
                    itemData.value.sending_tlj = v.tlj.id
                }
            })
        }else{
            sendList.value.map((v,i)=>{
                if(v.id == e){
                    arriveJuList.value = [v.tlj]
                    itemData.value.come_tlj = v.tlj.id
                }
            })
        }
        
    }
    const handleChangeBoxType = (e,index)=>{
        boxTypeList.value.map((v,i)=>{
            if(v.id == e){
                boxData.value[index].box_type = v.name
            }
        })
    }
    const handleDel = (index,type) =>{
        if(type == 1){
            boxData.value.splice(index,1) 
        }else if(type == 2){
            zhengcheData.value.splice(index,1) 
        }else if(type == 3){
            plkyData.value.splice(index,1) 
        }
    }
    const handleAdd = (record,index,type) =>{
        if(type == 1){
            boxData.value.splice(index,0,{ticket_number:'',  
            goods_id:record.goods_id,  
            baozhuang:'',  
            box:'',  
            is_empty:'2',
            box_belong:'',
            box_type:'',  
            box_type_id:'',    
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            size:'',
            caozuo:'',
            type:1})
        }else if(type == 2){
            zhengcheData.value.splice(index,0,{ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            caozuo:'',
            type:1})
        }else if(type == 3){
            plkyData.value.splice(index,0,{ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            size:'',
            caozuo:'',
            type:1})
        }
        
    }
    const boxData = ref([
        {
            ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            box:'',  
            is_empty:'2',  
            box_type:'',  
            box_type_id:'',  
            box_belong:'',
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            size:'',
            caozuo:'',
            type:1
        },
        {
            ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            box:'',  
            is_empty:'2',  
            box_type:'',  
            box_type_id:'',  
            box_belong:'',
            number:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'',  
            size:'',
            caozuo:'',
            type:2
        }
    ])
    const boxColumns = ref([
        {
            title: "原票号",
            dataIndex: "ticket_number",
            align: "center",
            slotName:'ticket_number',
            width: 150,
        },
        {
            title: "品名",
            dataIndex: "goods_id",
            align: "center",
            slotName:'goods_id',
            width: 150,
        },
        {
            title: "包装",
            dataIndex: "baozhuang",
            align: "center",
            slotName:'baozhuang',
            width: 100,
        },
        {
            title: "箱号",
            dataIndex: "box",
            align: "center",
            slotName:'box',
            width: 150,
        },
        {
            title: "箱型箱类",
            dataIndex: "box_type_id",
            align: "center",
            slotName:'box_type_id',
            width: 150,
        },
        {
            title: "空重状态",
            dataIndex: "is_empty",
            align: "center",
            slotName:'is_empty',
            width: 120,
        },
        {
            title: "箱属",
            dataIndex: "box_belong",
            align: "center",
            slotName:'box_belong',
            width: 120,
        },
        {
            title: "件数",
            dataIndex: "number_yu",
            align: "center",
            slotName:'number_yu',
            width: 100,
        },
        {
            title: "货重",
            dataIndex: "hz_weight",
            align: "center",
            slotName:'hz_weight',
            width: 100,
        },
        {
            title: "计费重量",
            dataIndex: "jf_weight",
            align: "center",
            slotName:'jf_weight',
            width: 100,
        },
        {
            title: "标重",
            dataIndex: "bz_weight",
            align: "center",
            slotName:'bz_weight',
            width: 100,
        },
        {
            title: "承运人重量",
            dataIndex: "cyr_weight",
            align: "center",
            slotName:'cyr_weight',
            width: 100,
        },
        {
            title: "体积",
            dataIndex: "size",
            align: "center",
            slotName:'size',
            width: 100,
        },
        {
            title: "操作",
            dataIndex: "caozuo",
            align: "center",
            slotName:'caozuo',
            width: 100,
            fixed: 'right',
        },
    ])
    const zhengcheData = ref([
        {
            ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            caozuo:'',
            type:1
        },
       
    ])
    const zhengcheColumns = ref([
        {
            title: "原票号",
            dataIndex: "ticket_number",
            align: "center",
            slotName:'ticket_number',
            width: 150,
        },
        {
            title: "品名",
            dataIndex: "goods_id",
            align: "center",
            slotName:'goods_id',
            width: 150,
        },
        {
            title: "包装",
            dataIndex: "baozhuang",
            align: "center",
            slotName:'baozhuang',
            width: 100,
        },
        {
            title: "件数",
            dataIndex: "number_yu",
            align: "center",
            slotName:'number_yu',
            width: 100,
        },
        {
            title: "货重",
            dataIndex: "hz_weight",
            align: "center",
            slotName:'hz_weight',
            width: 100,
        },
        {
            title: "计费重量",
            dataIndex: "jf_weight",
            align: "center",
            slotName:'jf_weight',
            width: 100,
        },
        {
            title: "标重",
            dataIndex: "bz_weight",
            align: "center",
            slotName:'bz_weight',
            width: 100,
        },
        {
            title: "承运人重量",
            dataIndex: "cyr_weight",
            align: "center",
            slotName:'cyr_weight',
            width: 100,
        },
    ])
    const plkyData = ref([
        {
            ticket_number:'',  
            goods_id:'',  
            baozhuang:'',  
            number_yu:'',  
            hz_weight:'',  
            bz_weight:'',  
            jf_weight:'',  
            cyr_weight:'', 
            size:'',
            caozuo:'',
            type:1
        },
    ])
    const plkyColumns = ref([
        {
            title: "原票号",
            dataIndex: "ticket_number",
            align: "center",
            slotName:'ticket_number',
            width: 150,
        },
        {
            title: "品名",
            dataIndex: "goods_id",
            align: "center",
            slotName:'goods_id',
            width: 150,
        },
        {
            title: "包装",
            dataIndex: "baozhuang",
            align: "center",
            slotName:'baozhuang',
            width: 100,
        },
        {
            title: "件数",
            dataIndex: "number_yu",
            align: "center",
            slotName:'number_yu',
            width: 100,
        },
        {
            title: "货重",
            dataIndex: "hz_weight",
            align: "center",
            slotName:'hz_weight',
            width: 100,
        },
        {
            title: "计费重量",
            dataIndex: "jf_weight",
            align: "center",
            slotName:'jf_weight',
            width: 100,
        },
        {
            title: "标重",
            dataIndex: "bz_weight",
            align: "center",
            slotName:'bz_weight',
            width: 100,
        },
        {
            title: "承运人重量",
            dataIndex: "cyr_weight",
            align: "center",
            slotName:'cyr_weight',
            width: 100,
        },
        {
            title: "体积",
            dataIndex: "size",
            align: "center",
            slotName:'size',
            width: 100,
        },
        
    ])
    const zhangdanshuaxin = ()=>{
        showBill.value = false
        emits('succ')
    }
    // 保存
    const handleBaoCun = (tab)=>{
        console.log(itemData.value)
        if(!areValuesNotEmpty(itemData.value)){
            return Message.error('请添加数据，数据不能为空')
        }
        let requestData = JSON.parse(JSON.stringify(itemData.value))
        let jsonData = []
        if(itemData.value.transport_type == 1){
            boxData.value.map((v,i)=>{
                if(v.type == 1){
                    jsonData.push(v)
                }
            })
        }else if(itemData.value.transport_type == 2){
            zhengcheData.value.map((v,i)=>{
                if(v.type == 1){
                    jsonData.push(v)
                }
            })
        }else if(itemData.value.transport_type == 4){
            plkyData.value.map((v,i)=>{
                if(v.type == 1){
                    jsonData.push(v)
                }
            })
        }
        
        let number_yu = 0
        let hz_weight = 0
        let jf_weight = 0
        let bz_weight = 0
        let cyr_weight = 0
        console.log(jsonData)
        if(!areAllValuesDefined(jsonData)){
            return Message.error('请添加数据，表格中数据不能为空')
        }
        let ticket_numberArr = []
        jsonData.map((v,i)=>{
            number_yu += (v.number_yu - 0)
            hz_weight += (v.hz_weight - 0)
            jf_weight += (v.jf_weight - 0)
            bz_weight += (v.bz_weight - 0)
            cyr_weight += (v.cyr_weight - 0)
            ticket_numberArr.push(v.ticket_number)
        })
        requestData.ticket_number = ticket_numberArr.join(',')
        requestData.number_yu = number_yu
        requestData.hz_weight = hz_weight
        requestData.jf_weight = jf_weight
        requestData.bz_weight = bz_weight
        requestData.cyr_weight = cyr_weight
        requestData.goods_id = jsonData[0].goods_id
        requestData.goods_data = jsonData
        requestData.type = 2
        if(requestData.service_type == 1 || requestData.service_type == 3){
            requestData.shipping_tel = ''
            requestData.shipping_address = ''
        }
        console.log('传输的数据：',requestData)
        predictionManage.save(requestData).then(res=>{
            if(res.code == 200){
                Message.success('新增成功！')
                if(tab == 1){
                    emits('succ')
                }else{
                    billData.value.ids = res.data.id.join(',')
                    showBill.value = true
                }
            }else{
                // Message.error(res.message)
            }
            
            
        })
    }
    // 判断对象里面的值不能为空
    const areValuesNotEmpty = (obj)=>{
        console.log("obj:",obj)
        for (const key in obj) {
            if (obj.hasOwnProperty(key) && !obj[key] && key != 'shipping_address' && key != 'shipping_tel' && key != 'shipping') {
                return false;
            }
        }
        return true;
    }
    // 判断数组中的值不为空
    const areAllValuesDefined = (arr) =>{
        if(itemData.value.transport_type == 1){
            return arr.every((item)=> {
                return item.goods_id !== '' && item.ticket_number !== '' && item.box !== '' && item.is_empty !== '' && item.box_type !== '' && item.box_belong !== '' && item.number_yu !== '' && item.hz_weight !== '' && item.bz_weight !== '' && item.cyr_weight !== '' && item.jf_weight !== '';
            });
        }else{
            return arr.every((item)=> {
                return item.goods_id !== '' && item.ticket_number !== '' && item.number_yu !== '' && item.hz_weight !== '' && item.bz_weight !== '' && item.cyr_weight !== '' && item.jf_weight !== '';
            });
        }
    }



    
</script>
<style lang="less" scoped>
.input {
	padding: 4px 12px;
	background: #fff;
	border: 1px solid rgba(242, 243, 245);
	border-radius: 4px;
	outline: none;
	/*清除input点击之后的黑色边框*/
}

.input:focus {
	background: #fff;
	border: 1px solid #1e80ff;
}
.jcBox{
    width: calc((100% - 48px) / 5);
    margin-right: 12px;
    margin-bottom: 12px;
    &:nth-child(5n){
        margin-right: 0px;
    }
}
.contenBox::-webkit-scrollbar{
    display: none;
}
.marbot24{
    margin-bottom: 12px;
}
</style>
<script>
export default { name: "prediction:add" };
</script>
